package com.guanyong.services;

import com.guanyong.dao.IRoleDaoMapper;
import com.guanyong.model.RoleModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mxk on 2017/6/7.
 */

@Service
public class RoleService {
    @Autowired
    private IRoleDaoMapper iRoleDaoMapper;

    public Integer AddRole(RoleModel roleModel){
        return iRoleDaoMapper.insert(roleModel);
    }

    public Integer UpdateRole(RoleModel roleModel){
        return iRoleDaoMapper.update(roleModel);
    }

    public RoleModel GetRoleById(Integer fid){

        return  iRoleDaoMapper.GetRoleById(fid);
    }

    public List<RoleModel> GetRoleAll(){
        List<RoleModel> list =iRoleDaoMapper.GetAllRoleList();
        return  list;
    }
}
